import request from '@/utils/request'

/**
 * 入住管理相关接口
 */
// 查询入住管理列表
export function listCheckInManagement(query) {
  return request({
    url: '/system/management/list',
    method: 'get',
    params: query
  })
}

// 查询入住管理详细
export function getCheckInManagement(id) {
  return request({
    url: '/system/management/' + id,
    method: 'get'
  })
}

// 新增入住管理
export function addCheckInManagement(data) {
  return request({
    url: '/system/management',
    method: 'post',
    data: data
  })
}

// 修改入住管理
export function updateCheckInManagement(data) {
  return request({
    url: '/system/management',
    method: 'put',
    data: data
  })
}

// 删除入住管理
export function delCheckInManagement(ids) {
  return request({
    url: '/system/management/' + ids,
    method: 'delete'
  })
}

// 导出入住管理
export function exportCheckInManagement(query) {
  return request({
    url: '/system/management/export',
    method: 'post',
    params: query,
    responseType: 'blob'
  })
}

/**
 * 退住办理相关接口
 */
// 查询退住办理列表
export function listCheckOutManagement(query) {
  return request({
    url: '/system/out_management/list',
    method: 'get',
    params: query
  })
}

// 查询退住办理详细
export function getCheckOutManagement(id) {
  return request({
    url: '/system/out_management/' + id,
    method: 'get'
  })
}

// 新增退住办理
export function addCheckOutManagement(data) {
  return request({
    url: '/system/out_management',
    method: 'post',
    data: data
  })
}

// 修改退住办理
export function updateCheckOutManagement(data) {
  return request({
    url: '/system/out_management',
    method: 'put',
    data: data
  })
}

// 删除退住办理
export function delCheckOutManagement(ids) {
  return request({
    url: '/system/out_management/' + ids,
    method: 'delete'
  })
}

// 导出退住办理
export function exportCheckOutManagement(query) {
  return request({
    url: '/system/out_management/export',
    method: 'post',
    params: query,
    responseType: 'blob'
  })
}

/**
 * 订单管理相关接口
 */
// 查询订单管理列表
export function listOrderManagement(query) {
  return request({
    url: '/system/order_management/list',
    method: 'get',
    params: query
  })
}

// 查询订单管理详细
export function getOrderManagement(id) {
  return request({
    url: '/system/order_management/' + id,
    method: 'get'
  })
}

// 新增订单管理
export function addOrderManagement(data) {
  return request({
    url: '/system/order_management',
    method: 'post',
    data: data
  })
}

// 修改订单管理
export function updateOrderManagement(data) {
  return request({
    url: '/system/order_management',
    method: 'put',
    data: data
  })
}

// 删除订单管理
export function delOrderManagement(ids) {
  return request({
    url: '/system/order_management/' + ids,
    method: 'delete'
  })
}

// 导出订单管理
export function exportOrderManagement(query) {
  return request({
    url: '/system/order_management/export',
    method: 'post',
    params: query,
    responseType: 'blob'
  })
}

/**
 * 房间相关接口
 */
// 查询房间列表
export function listRoom(query) {
  return request({
    url: '/system/room/list',
    method: 'get',
    params: query
  })
}

// 查询房间详细
export function getRoom(id) {
  return request({
    url: '/system/room/' + id,
    method: 'get'
  })
}

// 新增房间
export function addRoom(data) {
  return request({
    url: '/system/room',
    method: 'post',
    data: data
  })
}

// 修改房间
export function updateRoom(data) {
  return request({
    url: '/system/room',
    method: 'put',
    data: data
  })
}

// 删除房间
export function delRoom(ids) {
  return request({
    url: '/system/room/' + ids,
    method: 'delete'
  })
}

// 导出房间
export function exportRoom(query) {
  return request({
    url: '/system/room/export',
    method: 'post',
    params: query,
    responseType: 'blob'
  })
}

/**
 * 老人相关接口
 */
// 查询老人列表
export function listElderly(query) {
  return request({
    url: '/system/elderly/list',
    method: 'get',
    params: query
  })
}

// 查询老人详细
export function getElderly(id) {
  return request({
    url: '/system/elderly/' + id,
    method: 'get'
  })
}

// 新增老人
export function addElderly(data) {
  return request({
    url: '/system/elderly',
    method: 'post',
    data: data
  })
}

// 修改老人
export function updateElderly(data) {
  return request({
    url: '/system/elderly',
    method: 'put',
    data: data
  })
}

// 删除老人
export function delElderly(ids) {
  return request({
    url: '/system/elderly/' + ids,
    method: 'delete'
  })
}

// 导出老人
export function exportElderly(query) {
  return request({
    url: '/system/elderly/export',
    method: 'post',
    params: query,
    responseType: 'blob'
  })
}

/**
 * 系统用户相关接口
 */
// 查询用户列表
export function listSysUser(query) {
  return request({
    url: '/system/user/list',
    method: 'get',
    params: query
  })
}

// 查询用户详细
export function getSysUser(id) {
  return request({
    url: '/system/user/' + id,
    method: 'get'
  })
}

// 新增用户
export function addSysUser(data) {
  return request({
    url: '/system/user',
    method: 'post',
    data: data
  })
}

// 修改用户
export function updateSysUser(data) {
  return request({
    url: '/system/user',
    method: 'put',
    data: data
  })
}

// 删除用户
export function delSysUser(ids) {
  return request({
    url: '/system/user/' + ids,
    method: 'delete'
  })
}

// 导出用户
export function exportSysUser(query) {
  return request({
    url: '/system/user/export',
    method: 'post',
    params: query,
    responseType: 'blob'
  })
}

// 导入用户
export function importSysUser(data) {
  return request({
    url: '/system/user/importData',
    method: 'post',
    data: data
  })
}

// 获取用户导入模板
export function getSysUserImportTemplate() {
  return request({
    url: '/system/user/importTemplate',
    method: 'post',
    responseType: 'blob'
  })
}

// 重置用户密码
export function resetSysUserPwd(data) {
  return request({
    url: '/system/user/resetPwd',
    method: 'put',
    data: data
  })
}

// 修改用户状态
export function changeSysUserStatus(data) {
  return request({
    url: '/system/user/changeStatus',
    method: 'put',
    data: data
  })
}

// 获取用户授权角色
export function getSysUserAuthRole(userId) {
  return request({
    url: '/system/user/authRole/' + userId,
    method: 'get'
  })
}

// 用户授权角色
export function authSysUserRole(data) {
  return request({
    url: '/system/user/authRole',
    method: 'put',
    params: data
  })
}

// 获取部门树列表
export function getSysDeptTree(query) {
  return request({
    url: '/system/user/deptTree',
    method: 'get',
    params: query
  })
}